<?php use_helper('Text') ?>
<?php use_helper('Date') ?>

<?php slot('title', "$article - ") ?>
<?php slot('area', "{$area}赛区") ?>

<!--Content-->
<div class="artlist_main">
   <div class="artlist_left">
      <div class="artlist_left_nav"><a href="<?php echo url_for('@article') ?>">最新资讯</a> &gt; 正文</div>
      <div class="artlist_left_tt">
      <div class="news_bt"><?php echo $article->getTitle() ?></div>
      <div class="news_smbt">
	  <?php echo date('Y年m月d日H:i', strtotime($article->getCreatedAt())) ?>
        <?php if (($ref = $article->getReference()) && ($url = $article->getReferenceUrl())): ?>
          <a href="<?php echo $url ?>"><?php echo $ref ?></a>
        <?php elseif ($ref): ?>
          <?php echo $ref ?>
        <?php else: ?>
          原创
        <?php endif ?></div>
		 <div class="news_smbt_cont">
          <?php if (count($pictures = $article->getPictures())): ?>
          <dl>
            <?php foreach ($pictures as $picture): ?>
              <dt>
                <img alt="picture" 
                  src="<?php printf(sfConfig::get('app_path_article_picture'), $picture->getPicture()) ?>" />
              </dt>
              <dd>
                <?php echo $picture->getDescription() ?>
              </dd>
            <?php endforeach ?>
          </dl>
        <?php endif ?>

        <?php echo html_entity_decode($article->getContent()) ?>
        </div>
 </div>
      <!--
      <div class="artlist_left_tt_pagesize">
         <p><a href="#">[ 1 ]</a></p>
         <p><a href="#">[ 2 ]</a></p>
         <p><a href="#">[ 3 ]</a></p>
         <p><a href="#">[ 4 ]</a></p>
         <p><a href="#">[ 5 ]</a></p>
         <p><a href="#">上一页</a></p>
         <p><a href="#">下一页</a></p>
      </div>
      -->
      <!--News-->
      <div class="news"><img src="/../images/article_news.gif" /></div>
      <div class="news_art">
         <ul>
            <?php foreach ($article->getRelatedQuery()->execute() as $a): ?>
            <li>
              <span class="date"><?php echo format_date($a->getCreatedAt(), 'yyyy-M-d') ?></span>
              <a href="<?php echo url_for('@article_show?id=' . $a->getId()) ?>"><?php echo $a->getTitle() ?></a>
            </li>
          <?php endforeach ?>
         </ul>
      </div>
      
      <!--Start-->
      <div class="news"><img src="/../images/article_pl.gif" /></div><!--发表评论-->
<div class="pl">
         <div class="pl_font">现在已经有<?php echo $article->getCommentCnt() ?>条评论 <a href="<?php echo url_for('@article_showcomments?articleid=' . $article->getId()) ?>">查看所有评论</a></div>
         <?php include_partial('Comment/form', array(
          'form' => $form,
          'articleId' => $sf_params->get('id')
        )) ?>
      </div>
      <!--Over-->
   </div>
   
   <div class="artlis_right">
      <div class="article_ad"><img src="/../images/article_article_ad.gif" /></div>
      <div class="artlist_right_1">
         <div class="artlist_title">报道关注</div>
         <div class="artlist_cont_main"> 
				<?php if (count($media)): ?>
                <ul>
				<?php foreach ($media as $article): ?>
                   <li><a href="<?php echo url_for('@article_show?id=' . $article->getId()) ?>"><?php echo truncate_text($article, 20, '..') ?></a></li>
				<?php endforeach ?>
                </ul>
				<?php endif ?>
         </div>
      </div>
      <div class="artlist_right_2">
         <span><a href="#" style="color:#e71e90;">更多 >></a></span>
		 <?php if (count($latest)): ?>
         <ul>
		 <?php foreach ($latest as $article): ?>
            <li><a href="<?php echo url_for('@article_show?id=' . $article->getId()) ?>"><?php echo truncate_text($article, 20, '..') ?></a></li>
		 <?php endforeach ?>
         </ul>
		 <?php endif ?>
      </div>
   </div>
   
   <div class="clears"></div>
</div>